# -*- coding: utf-8 -*-
# @Time    : 2021/10/30 0:47
# @Author  : TangDagui
# @Email   : 3297364807@qq.com
# @File    : PythonTwo.py
# @Software: PyCharm
from distutils.core import setup
from turtle import *
from random import *
def koch(size,n):
    if n == 0:
        fd(size)
    else:
        for angle in [0, 60, -120, 60]:
            left(angle)
            koch(size/3, n-1)
def color_k(r):
    if r ==1:
        color('red')
    elif r==2:
        color('green')
    elif r ==3:
        color('blue')
def number_k():
    m = randint(0, 100)
    for i in range(m):
        x = uniform(0, 600)
        y = uniform(0, 600)
        main_k(x, y)
def main_k(x,y):
    r = randint(0,3)
    color_k(r)
    setup(x, y)
    speed(1000)
    penup()
    goto(x, y)
    pendown()
    pensize(2)
    level = 2
    koch(40, level)
    right(120)
    koch(40, level)
    right(120)
    koch(40, level)
    hideturtle()
number_k()
